package cn.com.cifi.mars.web.action.integrated;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import cn.com.cifi.mars.common.constants.VersionConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@Api(tags = "Business_OA")
@RequestMapping("/${spring.data.rest.base-path}/{apiVersion}/oaIntegrated")
public interface IBusinessOAIntegratedController {

    @ApiOperation(value = "获取认证token",notes = "业务系统与OA集成-获取token")
    @PostMapping(value = "getToken")
    String getToken(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion);

    @ApiOperation(value = "保存流程实例",notes = "业务系统与OA集成-保存流程实例")
    @PostMapping(value = "saveFlow")
    String saveFlow(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "sessionToken", required = true) @RequestParam(name = "sessionToken") String sessionToken,
            @RequestBody String requestParam);

    @ApiOperation(value = "废弃流程实例",notes = "业务系统与OA集成-废弃流程实例")
    @PostMapping(value = "endFlow")
    String endFlow(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "sessionToken", required = true) @RequestParam(name = "sessionToken") String sessionToken,
            @RequestBody String requestParam);

    @ApiOperation(value = "删除流程实例",notes = "业务系统与OA集成-删除流程实例")
    @PostMapping(value = "deleteFlow")
    String deleteFlow(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "sessionToken", required = true) @RequestParam(name = "sessionToken") String sessionToken,
            @RequestBody String requestParam);

    @ApiOperation(value = "查询流程实例审批记录",notes = "业务系统与OA集成-查询流程实例审批记录")
    @PostMapping(value = "selectFlowOpinions")
    String selectFlowOpinions(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "sessionToken", required = true) @RequestParam(name = "sessionToken") String sessionToken,
            @RequestBody String requestParam);

    @ApiOperation(value = "查询流程实例审批路径",notes = "业务系统与OA集成-查询流程实例审批路径")
    @PostMapping(value = "selectFlowPath")
    String selectFlowPath(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "sessionToken", required = true) @RequestParam(name = "sessionToken") String sessionToken,
            @RequestBody String requestParam);
}
